<template>

  <el-dialog
      v-if="show"
      v-model="dialog"
      title="车辆详情"
      class="OrderDetailDialog"
      width="75%"
      :close-on-click-modal="false"
      :before-close="handleClose"
      top="4vh"
  >
    <el-row>
      <el-col :span="24">
        <div class="my_card">
          <div class="header">车辆基本信息</div>
          <el-row class="elrow">
            <el-col :span="8">
              <div class="title">车牌号</div>
              <span style="word-wrap: break-word">{{ detail.carNo }}</span>
            </el-col>
            <el-col :span="8">
              <div class="title">车辆状态</div>
              <span style="word-wrap: break-word">{{ statusNum(detail.status) }}</span>
            </el-col>
            <el-col :span="8">
              <div class="title">入库时间</div>
              <span style="word-wrap: break-word">{{ detail.createTime }}</span>
            </el-col>
            <el-col :span="8">
              <div class="title">车辆类型</div>
              <span>{{ detail.carType }}</span>
            </el-col>
            <el-col :span="8">
              <div class="title">车辆颜色</div>
              <span>{{ detail.carColor }}</span>
            </el-col>
            <el-col :span="8">
              <div class="title">司机</div>
              <span>{{ detail.driverName }}</span>
            </el-col>
          </el-row>
        </div>

      </el-col>

    </el-row>
  </el-dialog>
</template>

<script lang="ts" setup>
import { nextTick, onMounted, reactive, ref, watch, withDefaults } from 'vue'
import {getUserinfoById} from "@/api/apis/userManageApi";
import api from '@/api/apis/orderApi'

//详情数据
const detailDriver = ref({
  mobileNo:'',
  vehicleNo:''
})
onMounted(()=>{
  // getDetailDriverApi()

})
const props = withDefaults(defineProps<Props>(), {
  show: false,
  // detailId:'',
  detail: {},

})


interface Props {
  show: boolean
  detail: any
}
const dialog = ref(true)

// withDefaults(defineProps<Props>(), {
//   show: false,
//   detail: {},
// })
const emit = defineEmits<{
  (event: 'update:show', val: boolean): void
}>()
//弹框关闭
const handleClose = () => {
  emit('update:show', false)
}

const statusNum = (value: string) => {
  let obj: any = {
    0: '未使用',
    1: '使用中',
  }
  return obj[value]
}

</script>

<style lang="scss">
.OrderDetailDialog {
  .el-dialog__body {
    padding: 0px 20px 10px;
  }
  .el-timeline {
    padding: 20px;
  }
  .equipmentBox{
    padding: 20px 10px;
    margin: 10px;
    align-items: center;
    box-sizing: border-box;
    background-color: #C4F4DA ;
    display: flex;
    justify-content: space-between;
    border-radius: 10px;
    color: #0E7B5C ;
  }
  .alignCenter{
    display: flex;
    align-items: center;
  }
  .my_card {
    border: 1px solid rgba(220, 221, 221, 1);
    border-radius: 10px;
    // padding: 13px 0;
    margin-bottom: 10px;
    .header {
      color: rgba(16, 16, 16, 1);
      font-size: 16px;
      border-bottom: 1px solid rgba(220, 221, 221, 1);
      padding: 10px 24px;
      font-weight: 600;
    }
    .flexBetween {
      display: flex;
      width: 100%;
      justify-content: space-between;
      .leftTitle {
        width: 70px;
        display: inline-block;
      }
    }
    .price {
      display: inline-block;
      width: 30px;
    }
    .fontBold {
      font-weight: bold;
      color: #333;
      font-size: 15px;
    }
    .elrow {
      // text-align: right;
      border-top: 1px solid rgba(220, 221, 221, 1);
      padding: 10px 24px;
      .title {
        font-weight: 600;
        color: #333;
      }

      .flexBox {
        display: flex;
        align-items: center;
        p {
          margin: 0 10px;
        }
        .remark {
          color: #a7a7b3;
        }
        .el-icon {
          margin-right: 5px;
        }
      }
      .el-col {
        margin-bottom: 10px;
      }
    }
    .elrow:nth-child(2) {
      border-top: none !important;
    }
  }
}
</style>
